#ifndef MUDNMUCKRANDOM
#define MUDNMUCKRANDOM
#include <cstdlib>
#include <string>

int RandomNumber(int low,int high)
{
     return(rand() % (high - low + 1) + low);
}

char PickChar(std::string str)
{
     return(str.at(RandomNumber(0,str.length()-1)));
}

std::string RandomName(int low, int high)
{
     static const std::string consonants = "bcdfghjklmnpqrstvwxz";
     static const std::string vowels = "aeiouy";
     std::string name;     
     static int coin = 0;
     int length = RandomNumber(low,high);
     char letter = 0,oldletter = 0;
     for(int counter = 0; counter < length; counter++)
     {
          coin = RandomNumber(0,100);     
          letter = (letter == oldletter) ? ((coin <= 60) ? PickChar(vowels) : PickChar(consonants)) : letter;
          letter = (counter == 0) ? toupper(letter) : letter;
          name += letter;
          oldletter = letter;
     }
     return(name);
}

#endif
